package sync.hw.teacher.demo02;

/**
 * @author lwj
 * @date 2025-03-13
 * @vesion 1.0.0
 */
public class MyRunnable implements Runnable{
    /**
     * 打印机
     */
    private Printer printer;
    /**
     * 使用者
     */
    private String user;
    /**
     * 打印的内容
     */
    private String msg;

    // 构造方法
    public MyRunnable() {}

    public MyRunnable(Printer printer, String user, String msg) {
        this.printer = printer;
        this.user = user;
        this.msg = msg;
    }

    @Override
    public void run() {
        // 打印数据
        printer.print(user,msg);
    }
}
